const Controller = require('egg').Controller;

class ClassifyController extends Controller {
  //左侧导航
  async lClassify() {
    const { ctx } = this;
    try {
      let  lClassify= await ctx.service.classify.lclassify();
      ctx.response.body = lClassify
    } catch (e) {
      ctx.response.body = {
        code: 0,
        msg: e.message
      }
    }
  }
//右侧商品
  async rClassify() {
    const { ctx } = this;
    try{
      let {id} = ctx.request.body;
      console.log(id)
      let lClassify = await ctx.service.classify.rclassify(id);
      ctx.response.body=lClassify
    }catch(e){
      ctx.response.body={
        code:0,
        msg:e.message
      }
    }
  }
}

module.exports = ClassifyController;
